<!DOCTYPE html>
<canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none;"></canvas> 
<script type="text/javascript" src="//cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script> 
<script type="text/javascript" src="/js/fireworks.js"></script>

<html lang="en">
<head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
<title>Matlab读写超过4GB的图像 - Notouch</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">



    <meta name="description" content="💬 Brief introduction to the TIFF formatA TIFF file is, well, a Tagged Image File Format (TIFF). As the name implies, the file itself consists of a whole bunch of ‘tags’ and corresponding values. For">
<meta name="keywords" content="Matlab,Bigtiff">
<meta property="og:type" content="article">
<meta property="og:title" content="Matlab读写超过4GB的图像">
<meta property="og:url" content="http://notouch.top/2019/10/15/Matlab读写超过4GB的图像/index.html">
<meta property="og:site_name" content="Notouch">
<meta property="og:description" content="💬 Brief introduction to the TIFF formatA TIFF file is, well, a Tagged Image File Format (TIFF). As the name implies, the file itself consists of a whole bunch of ‘tags’ and corresponding values. For">
<meta property="og:locale" content="en">
<meta property="og:image" content="https://images.pexels.com/photos/2437299/pexels-photo-2437299.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500">
<meta property="og:updated_time" content="2019-10-29T16:28:06.125Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Matlab读写超过4GB的图像">
<meta name="twitter:description" content="💬 Brief introduction to the TIFF formatA TIFF file is, well, a Tagged Image File Format (TIFF). As the name implies, the file itself consists of a whole bunch of ‘tags’ and corresponding values. For">
<meta name="twitter:image" content="https://images.pexels.com/photos/2437299/pexels-photo-2437299.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500">







<link rel="icon" href="/images/bitbug_favicon.ico">


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.7.2/css/bulma.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/monokai-sublime.css">


    
    
    
    <style>body>.footer,body>.navbar,body>.section{opacity:0}</style>
    

    
    
    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">
    

    
    

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">


    
    
    
    

<link rel="stylesheet" href="/css/back-to-top.css">


    
    

    
    
    
    

    
    
<link rel="stylesheet" href="/css/progressbar.css">
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>

    
    
    

    
    
    
        <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    

    


<link rel="stylesheet" href="/css/style.css">
</head>

<script src="https://cdn.zrahh.com/js/instantclick-1.2.2.js" type="module"></script>

<body class="is-3-column">
	<!-- 样式二（飘动的彩带） -->
	<script src="https://g.joyinshare.com/hc/piao.js" type="text/javascript"></script>
    <nav class="navbar navbar-main">
    <div class="container">
        <div class="navbar-brand is-flex-center">
            <a class="navbar-item navbar-logo" href="/">
            
                <img src="/images/dk_logo.svg" alt="Matlab读写超过4GB的图像" height="28">
            
            </a>
        </div>
        <div class="navbar-menu">
            
            <div class="navbar-start">
                
                <a class="navbar-item" href="/">Home</a>
                
                <a class="navbar-item" href="/archives">Archives</a>
                
                <a class="navbar-item" href="/categories">Categories</a>
                
                <a class="navbar-item" href="/tags">Tags</a>
                
                <a class="navbar-item" href="/about">About</a>
                
            </div>
            
            <div class="navbar-end">
                
                    
                    
                    <a class="navbar-item" target="_blank" title="Download on GitHub" href="https://github.com/duankong">
                        
                        <i class="fab fa-github"></i>
                        
                    </a>
                    
                
                
                <a class="navbar-item is-hidden-tablet catalogue" title="Catalogue" href="javascript:;">
                    <i class="fas fa-list-ul"></i>
                </a>
                
                
                <a class="navbar-item search" title="Search" href="javascript:;">
                    <i class="fas fa-search"></i>
                </a>
                
            </div>
        </div>
    </div>
</nav>
    
    
    <section class="section">
        <div class="container">
            <div class="columns">
                <div class="column is-6-tablet is-6-desktop is-9-widescreen has-order-2 column-main"><div class="card">
	

    
    <div class="card-image">
        <span class="image is-7by1">
            <img class="thumbnail" src="https://images.pexels.com/photos/2437299/pexels-photo-2437299.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=1&amp;w=500" alt="Matlab读写超过4GB的图像">
        </span>
    </div>
    
    
    <div class="card-content article ">
		
        
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
            
			
                <time class="level-item has-text-grey" datetime="2019-10-15T04:10:09.000Z">2019-10-15</time>
                
                
                <div class="level-item">
                <a class="has-link-grey -link" href="/categories/Learning/">Learning</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/Learning/Matlab/">Matlab</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    7 minutes read (About 1008 words)
                </span>
                
                
                <span class="level-item has-text-grey" id="busuanzi_container_page_pv">
                    <i class="far fa-eye"></i>
                    <span id="busuanzi_value_page_pv">0</span> visits
                </span>
                
            </div>
        </div>
        
        
		
		
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
			
            
                Matlab读写超过4GB的图像
            

        </h1>
        
        <div class="content">
            <h4 id="💬-Brief-introduction-to-the-TIFF-format"><a href="#💬-Brief-introduction-to-the-TIFF-format" class="headerlink" title="💬 Brief introduction to the TIFF format"></a>💬 Brief introduction to the TIFF format</h4><p>A TIFF file is, well, a Tagged Image File Format (TIFF). As the name implies, the file itself consists of a whole bunch of ‘tags’ and corresponding values. For example, all TIFF files are expected to have the ImageWidth and ImageLength tags, whose values are the width and length (height) of the image stored within.</p>
<p>A core feature of this format lies in how image data is organized in a physical file. TIFF allows for the image data to be stored in chunks as either ‘Tiles’ or ‘Strips’. You could think of a strip as a tile whose width is the same as the image. The format stores offsets for each of these strips or tiles in an image header. This allows for efficient random access of any chunk in the image. The original TIFF format specification calls for use of 32 bit file offset values. I guess you can imagine where I am going with that bit of information. 32 bits implies a maximum value of 2^32 for any offset. Note that these are offsets from the very beginning of the file. In effect, the 32 bit requirement limits the size of the largest possible TIFF file to be under 4 gigabytes. This was fine for a long time (The earliest TIFF release was in 1986), but we now have more data producers hitting this limit.</p>
<a id="more"></a> 
<hr>
<h3 id="💦-读取图片"><a href="#💦-读取图片" class="headerlink" title="💦 读取图片"></a>💦 读取图片</h3><hr>
<p>Matlab中imread()支持读取超过4GB的tiff图像。当然也支持<a href="http://www.libtiff.org" target="_blank" rel="noopener">LibTIFF</a>自带的读取函数：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">函数</th>
<th style="text-align:center">Function</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"> <a href="https://ww2.mathworks.cn/help/matlab/ref/tiff.read.html" target="_blank" rel="noopener">read</a></td>
<td style="text-align:center">读取整个 TIFF 图像</td>
</tr>
<tr>
<td style="text-align:center"><a href="https://ww2.mathworks.cn/help/matlab/ref/tiff.readencodedstrip.html" target="_blank" rel="noopener">readEncodedStrip</a></td>
<td style="text-align:center">从指定条带读取数据</td>
</tr>
<tr>
<td style="text-align:center"> <a href="https://ww2.mathworks.cn/help/matlab/ref/tiff.readencodedtile.html" target="_blank" rel="noopener">readEncodedTile</a></td>
<td style="text-align:center">从指定图块读取数据</td>
</tr>
</tbody>
</table>
</div>
<hr>
<h3 id="💨-写入图片"><a href="#💨-写入图片" class="headerlink" title="💨 写入图片"></a>💨 写入图片</h3><hr>
<p>从<a href="http://www.libtiff.org" target="_blank" rel="noopener">LibTIFF</a>版本4.0.0开始，其偏移值格式使用64位而不是32位的，故后面也叫做Bigtiff，理论上最大可以支持17,179,869,184‬GB的图片。</p>
<h5 id="🚵-实现思路"><a href="#🚵-实现思路" class="headerlink" title="🚵 实现思路"></a>🚵 实现思路</h5><p>Matlab中以 obj.TiffObject = Tiff(obj.Filename, ‘w8’)方式开始写入Bigtiff；<br>然后结合blockproc函数分块写入图像。</p>
<h3 id="🙌-代码实现"><a href="#🙌-代码实现" class="headerlink" title="🙌 代码实现"></a>🙌 代码实现</h3><p>实现16位灰度图像写入。</p>
<h5 id="🤹‍-参考Steve-on-Image-Processing-and-MATLAB构造ImageAdapter类"><a href="#🤹‍-参考Steve-on-Image-Processing-and-MATLAB构造ImageAdapter类" class="headerlink" title="🤹‍ 参考Steve on Image Processing and MATLAB构造ImageAdapter类"></a>🤹‍ 参考<a href="https://blogs.mathworks.com/steve/2013/08/07/tiff-bigtiff-and-blockproc/" target="_blank" rel="noopener">Steve on Image Processing and MATLAB</a>构造ImageAdapter类</h5> <figure class="highlight matlab hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br></pre></td><td class="code"><pre><span class="line"> <span class="hljs-keyword">classdef</span> bigTiffWriter &lt; ImageAdapter</span><br><span class="line">    <span class="hljs-comment">%BIGTIFFWRITER - A basic image adapter to write Big TIFF files.</span></span><br><span class="line">    <span class="hljs-comment">%</span></span><br><span class="line">    <span class="hljs-comment">% A simple ImageAdapter class implementing a Tiff writer ImageAdapter</span></span><br><span class="line">    <span class="hljs-comment">% object for use with BLOCKPROC. </span></span><br><span class="line">    <span class="hljs-comment">% - Tile dimensions must be multiples of 16.</span></span><br><span class="line">    <span class="hljs-comment">% - Only uint8, RGB input image data is supported.</span></span><br><span class="line">    <span class="hljs-comment">%</span></span><br><span class="line">    <span class="hljs-comment">% Based on "Working with Data in Unsupported Formats"</span></span><br><span class="line">    <span class="hljs-comment">% http://www.mathworks.com/help/toolbox/images/f7-12726.html#bse_q4y-1</span></span><br><span class="line">    <span class="hljs-comment">%</span></span><br><span class="line">    <span class="hljs-comment">% Example:</span></span><br><span class="line">    <span class="hljs-comment">%    %%</span></span><br><span class="line">    <span class="hljs-comment">%    % Set file names and obtain size information from input file.</span></span><br><span class="line">    <span class="hljs-comment">%    inFile        = 'example.tif';</span></span><br><span class="line">    <span class="hljs-comment">%    inFileInfo    = imfinfo(inFile);</span></span><br><span class="line">    <span class="hljs-comment">%    outFile       = 'out.tif';</span></span><br><span class="line">    <span class="hljs-comment">%    %%</span></span><br><span class="line">    <span class="hljs-comment">%    % Create an output TIFF file with tile size of 128x128 </span></span><br><span class="line">    <span class="hljs-comment">%    tileSize      = [128, 128]; % has to be a multiple of 16.</span></span><br><span class="line">    <span class="hljs-comment">%    outFileWriter = bigTiffWriter(outFile, inFileInfo(1).Height, inFileInfo(1).Width, tileSize(1), tileSize(2));</span></span><br><span class="line">    <span class="hljs-comment">%    %%</span></span><br><span class="line">    <span class="hljs-comment">%    % Now call blockproc to rearrange the color channels.</span></span><br><span class="line">    <span class="hljs-comment">%    blockproc(inFile, tileSize, @(b) flipdim(b.data,3), 'Destination', outFileWriter);</span></span><br><span class="line">    <span class="hljs-comment">%    outFileWriter.close();</span></span><br><span class="line">    <span class="hljs-comment">%    imshowpair(imread(inFile), imread(outFile),'montage');</span></span><br><span class="line">    <span class="hljs-comment">%</span></span><br><span class="line">    <span class="hljs-comment">% See also: blockproc, Tiff, Tiff/writeEncodedTile</span></span><br><span class="line">    <span class="hljs-comment">%</span></span><br><span class="line">    </span><br><span class="line">    <span class="hljs-comment">%   Copyright 2013 The MathWorks, Inc.</span></span><br><span class="line">    </span><br><span class="line">    <span class="hljs-keyword">properties</span>(GetAccess = public, SetAccess = private)        </span><br><span class="line">        Filename;        </span><br><span class="line">        TiffObject;</span><br><span class="line">        TileLength;</span><br><span class="line">        TileWidth;        </span><br><span class="line">    <span class="hljs-keyword">end</span></span><br><span class="line">    </span><br><span class="line">    <span class="hljs-keyword">methods</span></span><br><span class="line">        </span><br><span class="line">        <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">obj</span> = <span class="hljs-title">bigTiffWriter</span><span class="hljs-params">(fname, imageLength, imageWidth, tileLength, tileWidth)</span></span></span><br><span class="line">            <span class="hljs-comment">% Constructor</span></span><br><span class="line">            </span><br><span class="line">            validateattributes(fname,       &#123;<span class="hljs-string">'char'</span>&#125;,   &#123;<span class="hljs-string">'row'</span>&#125;);</span><br><span class="line">            validateattributes(imageLength, &#123;<span class="hljs-string">'numeric'</span>&#125;,&#123;<span class="hljs-string">'scalar'</span>&#125;);</span><br><span class="line">            validateattributes(imageWidth,  &#123;<span class="hljs-string">'numeric'</span>&#125;,&#123;<span class="hljs-string">'scalar'</span>&#125;);</span><br><span class="line">            validateattributes(tileLength,  &#123;<span class="hljs-string">'numeric'</span>&#125;,&#123;<span class="hljs-string">'scalar'</span>&#125;);</span><br><span class="line">            validateattributes(tileWidth,   &#123;<span class="hljs-string">'numeric'</span>&#125;,&#123;<span class="hljs-string">'scalar'</span>&#125;);</span><br><span class="line">            </span><br><span class="line">            <span class="hljs-keyword">if</span>(<span class="hljs-built_in">mod</span>(tileLength,<span class="hljs-number">16</span>)~=<span class="hljs-number">0</span> || <span class="hljs-built_in">mod</span>(tileWidth,<span class="hljs-number">16</span>)~=<span class="hljs-number">0</span>)</span><br><span class="line">                error(<span class="hljs-string">'bigTiffWriter:invalidTileSize'</span>,...</span><br><span class="line">                    <span class="hljs-string">'Tile size must be a multiple of 16'</span>);</span><br><span class="line">            <span class="hljs-keyword">end</span></span><br><span class="line">            </span><br><span class="line">            obj.Filename   = fname;</span><br><span class="line">            obj.ImageSize  = [imageLength, imageWidth];</span><br><span class="line">            obj.TileLength = tileLength;</span><br><span class="line">            obj.TileWidth  = tileWidth;</span><br><span class="line">            </span><br><span class="line">            <span class="hljs-comment">% Create the Tiff object.</span></span><br><span class="line">            obj.TiffObject = Tiff(obj.Filename, <span class="hljs-string">'w8'</span>);</span><br><span class="line">            </span><br><span class="line">            <span class="hljs-comment">% Setup the tiff file properties</span></span><br><span class="line">            <span class="hljs-comment">% See "Exporting Image Data and Metadata to TIFF files</span></span><br><span class="line">            <span class="hljs-comment">% http://www.mathworks.com/help/techdoc/import_export/f5-123068.html#br_c_iz-1</span></span><br><span class="line">            <span class="hljs-comment">%</span></span><br><span class="line">            obj.TiffObject.setTag(<span class="hljs-string">'ImageLength'</span>,   obj.ImageSize(<span class="hljs-number">1</span>));</span><br><span class="line">            obj.TiffObject.setTag(<span class="hljs-string">'ImageWidth'</span>,    obj.ImageSize(<span class="hljs-number">2</span>));</span><br><span class="line">            obj.TiffObject.setTag(<span class="hljs-string">'TileLength'</span>,    obj.TileLength);</span><br><span class="line">            obj.TiffObject.setTag(<span class="hljs-string">'TileWidth'</span>,     obj.TileWidth);</span><br><span class="line">            obj.TiffObject.setTag(<span class="hljs-string">'Photometric'</span>,   Tiff.Photometric.MinIsBlack);<span class="hljs-comment">%图像数据的颜色空间</span></span><br><span class="line">            obj.TiffObject.setTag(<span class="hljs-string">'BitsPerSample'</span>, <span class="hljs-number">16</span>);</span><br><span class="line">            obj.TiffObject.setTag(<span class="hljs-string">'SampleFormat'</span>,  Tiff.SampleFormat.UInt);<span class="hljs-comment">%像素样本格式</span></span><br><span class="line">            obj.TiffObject.setTag(<span class="hljs-string">'SamplesPerPixel'</span>, <span class="hljs-number">1</span>);</span><br><span class="line">            obj.TiffObject.setTag(<span class="hljs-string">'PlanarConfiguration'</span>, Tiff.PlanarConfiguration.Chunky);  <span class="hljs-comment">%存储配置 </span></span><br><span class="line">            obj.TiffObject.setTag(<span class="hljs-string">'Compression'</span>, Tiff.Compression.LZW);  <span class="hljs-comment">%压缩方式</span></span><br><span class="line"></span><br><span class="line">            </span><br><span class="line">        <span class="hljs-keyword">end</span></span><br><span class="line">        </span><br><span class="line">        </span><br><span class="line">        <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">[]</span> = <span class="hljs-title">writeRegion</span><span class="hljs-params">(obj, region_start, region_data)</span></span></span><br><span class="line">            <span class="hljs-comment">% Write a block of data to the tiff file.</span></span><br><span class="line">            </span><br><span class="line">            <span class="hljs-comment">% Map region_start to a tile number.</span></span><br><span class="line">            tile_number = obj.TiffObject.computeTile(region_start);</span><br><span class="line">            </span><br><span class="line">            <span class="hljs-comment">% If region_data is greater than tile size, this function</span></span><br><span class="line">            <span class="hljs-comment">% warns, else it will silently pads with 0s.</span></span><br><span class="line">            obj.TiffObject.writeEncodedTile(tile_number, region_data);</span><br><span class="line">            </span><br><span class="line">        <span class="hljs-keyword">end</span></span><br><span class="line">        </span><br><span class="line">        </span><br><span class="line">        <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">data</span> = <span class="hljs-title">readRegion</span><span class="hljs-params">(~,~,~)</span> %#<span class="hljs-title">ok</span>&lt;<span class="hljs-title">STOUT</span>&gt;</span></span><br><span class="line">            <span class="hljs-comment">% Not .</span></span><br><span class="line">            error(<span class="hljs-string">'bigTiffWriter:noReadSupport'</span>,...</span><br><span class="line">                <span class="hljs-string">'Read support is not implemented.'</span>);</span><br><span class="line">        <span class="hljs-keyword">end</span></span><br><span class="line">        </span><br><span class="line">        </span><br><span class="line">        <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">close</span><span class="hljs-params">(obj)</span></span></span><br><span class="line">            <span class="hljs-comment">% Close the tiff file</span></span><br><span class="line">            obj.TiffObject.close();</span><br><span class="line">        <span class="hljs-keyword">end</span></span><br><span class="line">        </span><br><span class="line">    <span class="hljs-keyword">end</span>    </span><br><span class="line"><span class="hljs-keyword">end</span></span><br></pre></td></tr></table></figure>
<h5 id="👩‍👩‍👧‍👧-Demo实现"><a href="#👩‍👩‍👧‍👧-Demo实现" class="headerlink" title="👩‍👩‍👧‍👧  Demo实现"></a>👩‍👩‍👧‍👧  Demo实现</h5> <figure class="highlight matlab hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">inFileInfo    = <span class="hljs-built_in">size</span>(img);</span><br><span class="line">outFile       = img_name;</span><br><span class="line">tileSize      = [<span class="hljs-number">512</span>, <span class="hljs-number">512</span>]; <span class="hljs-comment">% has to be a multiple of 16.</span></span><br><span class="line">outFileWriter = bigTiffWriter(outFile, inFileInfo(<span class="hljs-number">1</span>), inFileInfo(<span class="hljs-number">2</span>), tileSize(<span class="hljs-number">1</span>), tileSize(<span class="hljs-number">2</span>));</span><br><span class="line">blockproc(img, tileSize, @(c) c.data, <span class="hljs-string">'Destination'</span>, outFileWriter);</span><br><span class="line">outFileWriter.close();</span><br></pre></td></tr></table></figure>
<h3 id="🙆-参考链接"><a href="#🙆-参考链接" class="headerlink" title="🙆 参考链接"></a>🙆 参考链接</h3><p><a href="http://www.libtiff.org" target="_blank" rel="noopener">LibTIFF</a><br><a href="https://ww2.mathworks.cn/matlabcentral/fileexchange/42086-bigtiffwriter" target="_blank" rel="noopener">bigTiffWriter</a><br><a href="https://blogs.mathworks.com/steve/2013/08/07/tiff-bigtiff-and-blockproc/" target="_blank" rel="noopener">Steve on Image Processing and MATLAB</a></p>
<hr>
<p>🤽‍  以上。(づ●─●)づ</p>
<p>转载请注明：<a href="http://notouch.top">Duankong的博客</a> » <a href="https://notouch.top/2019/10/15/Matlab%E8%AF%BB%E5%86%99%E8%B6%85%E8%BF%874GB%E7%9A%84%E5%9B%BE%E5%83%8F/#more">点击阅读原文</a></p>

        </div>
        
        <div class="level is-size-7 is-uppercase">
            <div class="level-start">
                <div class="level-item">
                    <span class="is-size-6 has-text-grey has-mr-7">#</span>
                    <a class="has-link-grey -link" href="/tags/Bigtiff/">Bigtiff</a>, <a class="has-link-grey -link" href="/tags/Matlab/">Matlab</a>
                </div>
            </div>
        </div>
        
        
        
        
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css">
<script src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js"></script>

        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="menu-label has-text-centered">Like this article? Support the author with</h3>
        <div class="buttons is-centered">
            
                
<a class="button is-info donate">
    <span class="icon is-small">
        <i class="fab fa-alipay"></i>
    </span>
    <span>Alipay</span>
    <div class="qrcode"><img src="/images/o_timg.gif" alt="Alipay"></div>
</a>

                
                
<a class="button is-success donate">
    <span class="icon is-small">
        <i class="fab fa-weixin"></i>
    </span>
    <span>Wechat</span>
    <div class="qrcode"><img src="/images/xiaomai.gif" alt="Wechat"></div>
</a>

                
                
<a class="button is-danger donate" href="https://github.com/duankong" target="_blank">
    <span class="icon is-small">
        <i class="fab fa-patreon"></i>
    </span>
    <span>Patreon</span>
</a>

                
        </div>
    </div>
</div>




<div class="card card-transparent">
    <div class="level post-navigation is-flex-wrap is-mobile">
        
        <div class="level-start">
            <a class="level level-item has-link-grey  article-nav-prev" href="/2019/10/17/C-基础知识/">
                <i class="level-item fas fa-chevron-left"></i>
                <span class="level-item">C++基础知识</span>
            </a>
        </div>
        
        
        <div class="level-end">
            <a class="level level-item has-link-grey  article-nav-next" href="/2018/11/30/Learning-notes-2018-11/">
                <span class="level-item">Learning notes_2018_11</span>
                <i class="level-item fas fa-chevron-right"></i>
            </a>
        </div>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="title is-5 has-text-weight-normal">Comments</h3>
        
<div id="comment-container"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1.4.1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1.4.1/dist/gitalk.min.js"></script>
<script>
    var gitalk = new Gitalk({
        clientID: '6cd559678e1f221043a2',
        clientSecret: '80e2f67e1a4202407fa9624190ed476d7cb3a86d',
        id: 'df07e8d0e5ce5d78ce01f74e708eb6ea',
        repo: 'duankong.github.io',
        owner: 'duankong',
        admin: "duankong"
    })
    gitalk.render('comment-container')
</script>

    </div>
</div>
</div>
                

<!-- 粘贴的部分 -->
                          <!-- 修改，可选保留的栏 -->




<div class="column is-4-tablet is-4-desktop is-3-widescreen  has-order-3 column-left is-sticky">
    
        
<div class="card widget">
    <div class="card-content">
        <nav class="level">
            <div class="level-item has-text-centered">
                <div>
                    
                        <img class="image is-128x128 has-mb-6" src="/images/xiaomai.gif" alt="Duankong">
                    
                    
                    <p class="is-size-4 is-block">
                        Duankong
                    </p>
                    
                    
                    <p class="is-size-6 is-block">
                        🌅总之岁月漫长，然而值得等待！
                    </p>
                    
                    
                    <p class="is-size-6 is-flex is-flex-center has-text-grey">
                        <i class="fas fa-map-marker-alt has-mr-7"></i>
                        <span>Wuhan.Hubei</span>
                    </p>
                    
                </div>
            </div>
        </nav>
        <nav class="level is-mobile">
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        Posts
                    </p>
                    <p class="title has-text-weight-normal">
                        14
                    </p>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        Categories
                    </p>
                    <p class="title has-text-weight-normal">
                        9
                    </p>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        Tags
                    </p>
                    <p class="title has-text-weight-normal">
                        50
                    </p>
                </div>
            </div>
        </nav>
        <div class="level">
            <a class="level-item button is-link is-rounded" href="https://github.com/duankong" target="_blank">
                Follow</a>
        </div>
        
        
        <div class="level is-mobile">
            
            <a class="level-item button is-white is-marginless" target="_blank" title="Github" href="https://github.com/duankong">
                
                <i class="fab fa-github"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" title="Facebook" href="https://facebook.com">
                
                <i class="fab fa-facebook"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" title="Twitter" href="https://twitter.com">
                
                <i class="fab fa-twitter"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" title="Dribbble" href="https://dribbble.com">
                
                <i class="fab fa-dribbble"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" title="RSS" href="/">
                
                <i class="fas fa-rss"></i>
                
            </a>
            
        </div>
        
    </div>
</div>
    
        
<div class="card widget" id="toc">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                Catalogue
            </h3>
            <ul class="menu-list"><ul class="menu-list"><li>
        <a class="is-flex" href="#💬-Brief-introduction-to-the-TIFF-format">
        <span class="has-mr-6">1.1</span>
        <span>💬 Brief introduction to the TIFF format</span>
        </a></li></ul><li>
        <a class="is-flex" href="#💦-读取图片">
        <span class="has-mr-6">2</span>
        <span>💦 读取图片</span>
        </a></li><li>
        <a class="is-flex" href="#💨-写入图片">
        <span class="has-mr-6">3</span>
        <span>💨 写入图片</span>
        </a><ul class="menu-list"><ul class="menu-list"><li>
        <a class="is-flex" href="#🚵-实现思路">
        <span class="has-mr-6">3.1.1</span>
        <span>🚵 实现思路</span>
        </a></li></ul></ul></li><li>
        <a class="is-flex" href="#🙌-代码实现">
        <span class="has-mr-6">4</span>
        <span>🙌 代码实现</span>
        </a><ul class="menu-list"><ul class="menu-list"><li>
        <a class="is-flex" href="#🤹‍-参考Steve-on-Image-Processing-and-MATLAB构造ImageAdapter类">
        <span class="has-mr-6">4.1.1</span>
        <span>🤹‍ 参考Steve on Image Processing and MATLAB构造ImageAdapter类</span>
        </a></li><li>
        <a class="is-flex" href="#👩‍👩‍👧‍👧-Demo实现">
        <span class="has-mr-6">4.1.2</span>
        <span>👩‍👩‍👧‍👧  Demo实现</span>
        </a></li></ul></ul></li><li>
        <a class="is-flex" href="#🙆-参考链接">
        <span class="has-mr-6">5</span>
        <span>🙆 参考链接</span>
        </a></li></ul>
        </div>
    </div>
</div>

    
        
<div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                Categories
            </h3>
            <ul class="menu-list">
            <li>
        <a class="level is-marginless" href="/categories/C/">
            <span class="level-start">
                <span class="level-item">C++</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">9</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/C/Algorithm/">
            <span class="level-start">
                <span class="level-item">Algorithm</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/C/Basic-knowledge/">
            <span class="level-start">
                <span class="level-item">Basic knowledge</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/C/PAT-Note/">
            <span class="level-start">
                <span class="level-item">PAT Note</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/Learning/">
            <span class="level-start">
                <span class="level-item">Learning</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/Learning/Dimensionality-Reduction/">
            <span class="level-start">
                <span class="level-item">Dimensionality-Reduction</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/Learning/Feature-Extraction/">
            <span class="level-start">
                <span class="level-item">Feature-Extraction</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/Learning/Matlab/">
            <span class="level-start">
                <span class="level-item">Matlab</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/Learning-Note/">
            <span class="level-start">
                <span class="level-item">Learning Note</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li>
            </ul>
        </div>
    </div>
</div>
    
        

<div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            Links
        </h3>
        <ul class="menu-list">
        
            <li>
                <a class="level is-mobile" href="https://github.com/duankong" target="_blank">
                    <span class="level-left">
                        <span class="level-item">Github</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">github.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://google.com" target="_blank">
                    <span class="level-left">
                        <span class="level-item">Google</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">google.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://baidu.com" target="_blank">
                    <span class="level-left">
                        <span class="level-item">Baidu</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">baidu.com</span>
                    </span>
                </a>
            </li>
        
        </ul>
        </div>
    </div>
</div>


    
        
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            Tag Cloud
        </h3>
        <a href="/tags/01背包问题/" style="font-size: 10px;">01背包问题</a> <a href="/tags/BST/" style="font-size: 10px;">BST</a> <a href="/tags/Bigtiff/" style="font-size: 10px;">Bigtiff</a> <a href="/tags/C/" style="font-size: 20px;">C++</a> <a href="/tags/Dijkstra/" style="font-size: 10px;">Dijkstra</a> <a href="/tags/Function/" style="font-size: 10px;">Function</a> <a href="/tags/KKT/" style="font-size: 10px;">KKT</a> <a href="/tags/LCS/" style="font-size: 10px;">LCS</a> <a href="/tags/Matlab/" style="font-size: 10px;">Matlab</a> <a href="/tags/PAT/" style="font-size: 10px;">PAT</a> <a href="/tags/PCA降维/" style="font-size: 10px;">PCA降维</a> <a href="/tags/Queue/" style="font-size: 10px;">Queue</a> <a href="/tags/String/" style="font-size: 10px;">String</a> <a href="/tags/hashing/" style="font-size: 10px;">hashing</a> <a href="/tags/hashing查找/" style="font-size: 10px;">hashing查找</a> <a href="/tags/三维图像/" style="font-size: 10px;">三维图像</a> <a href="/tags/中序遍历/" style="font-size: 10px;">中序遍历</a> <a href="/tags/二叉平衡树/" style="font-size: 10px;">二叉平衡树</a> <a href="/tags/二叉搜索树/" style="font-size: 10px;">二叉搜索树</a> <a href="/tags/二阶偏导数/" style="font-size: 10px;">二阶偏导数</a> <a href="/tags/先序遍历/" style="font-size: 10px;">先序遍历</a> <a href="/tags/凸函数，正交和投影/" style="font-size: 10px;">凸函数，正交和投影</a> <a href="/tags/动态规划/" style="font-size: 15px;">动态规划</a> <a href="/tags/变量类型/" style="font-size: 10px;">变量类型</a> <a href="/tags/后序遍历/" style="font-size: 10px;">后序遍历</a> <a href="/tags/堆排序/" style="font-size: 15px;">堆排序</a> <a href="/tags/字符串/" style="font-size: 10px;">字符串</a> <a href="/tags/完全二叉树/" style="font-size: 10px;">完全二叉树</a> <a href="/tags/容器/" style="font-size: 10px;">容器</a> <a href="/tags/常量/" style="font-size: 10px;">常量</a> <a href="/tags/并查集/" style="font-size: 10px;">并查集</a> <a href="/tags/广度-层次-遍历/" style="font-size: 10px;">广度(层次)遍历</a> <a href="/tags/归并排序/" style="font-size: 10px;">归并排序</a> <a href="/tags/拉格朗日乘子/" style="font-size: 10px;">拉格朗日乘子</a> <a href="/tags/拓扑排序/" style="font-size: 15px;">拓扑排序</a> <a href="/tags/指针/" style="font-size: 10px;">指针</a> <a href="/tags/插入排序/" style="font-size: 10px;">插入排序</a> <a href="/tags/文件读写/" style="font-size: 10px;">文件读写</a> <a href="/tags/无偏估计/" style="font-size: 10px;">无偏估计</a> <a href="/tags/朴素贝叶斯算法/" style="font-size: 10px;">朴素贝叶斯算法</a> <a href="/tags/树状数组/" style="font-size: 15px;">树状数组</a> <a href="/tags/梯度散度和旋度/" style="font-size: 10px;">梯度散度和旋度</a> <a href="/tags/海森矩阵/" style="font-size: 10px;">海森矩阵</a> <a href="/tags/深度遍历/" style="font-size: 10px;">深度遍历</a> <a href="/tags/病毒标记/" style="font-size: 10px;">病毒标记</a> <a href="/tags/算法/" style="font-size: 15px;">算法</a> <a href="/tags/红黑树/" style="font-size: 15px;">红黑树</a> <a href="/tags/背包问题/" style="font-size: 10px;">背包问题</a> <a href="/tags/迪杰斯特拉算法，最短路径/" style="font-size: 10px;">迪杰斯特拉算法，最短路径</a> <a href="/tags/高斯函数/" style="font-size: 10px;">高斯函数</a>
    </div>
</div>

    
    
        <div class="column-right-shadow is-hidden-widescreen is-sticky">
        
            
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            Recent
        </h3>
        
        <article class="media">
            
            <a href="/2019/12/09/Function-for-Check/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="https://images.pexels.com/photos/2994325/pexels-photo-2994325.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=1&amp;w=500" alt="Function for Check">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-12-09T10:24:41.000Z">2019-12-09</time></div>
                    <a href="/2019/12/09/Function-for-Check/" class="has-link-black-ter is-size-6">Function for Check</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/C/">C++</a> / <a class="has-link-grey -link" href="/categories/C/Basic-knowledge/">Basic knowledge</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2019/12/08/PAT-小结/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="https://images.pexels.com/photos/3290601/pexels-photo-3290601.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=1&amp;w=500" alt="PAT 小结">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-12-08T10:09:29.000Z">2019-12-08</time></div>
                    <a href="/2019/12/08/PAT-小结/" class="has-link-black-ter is-size-6">PAT 小结</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/C/">C++</a> / <a class="has-link-grey -link" href="/categories/C/PAT-Note/">PAT Note</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2019/12/08/PAT-Note-2/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="https://images.pexels.com/photos/3210189/pexels-photo-3210189.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=1&amp;w=500" alt="PAT Note 2">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-12-08T09:46:17.000Z">2019-12-08</time></div>
                    <a href="/2019/12/08/PAT-Note-2/" class="has-link-black-ter is-size-6">PAT Note 2</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/C/">C++</a> / <a class="has-link-grey -link" href="/categories/C/PAT-Note/">PAT Note</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2019/12/03/PAT-note-1/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="https://images.pexels.com/photos/33109/fall-autumn-red-season.jpg?auto=compress&amp;cs=tinysrgb&amp;dpr=1&amp;w=500" alt="PAT note 1">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-12-03T14:32:21.000Z">2019-12-03</time></div>
                    <a href="/2019/12/03/PAT-note-1/" class="has-link-black-ter is-size-6">PAT note 1</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/C/">C++</a> / <a class="has-link-grey -link" href="/categories/C/PAT-Note/">PAT Note</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2019/12/02/背包问题/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="https://images.pexels.com/photos/2931242/pexels-photo-2931242.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=1&amp;w=500" alt="背包问题">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-12-02T15:39:41.000Z">2019-12-02</time></div>
                    <a href="/2019/12/02/背包问题/" class="has-link-black-ter is-size-6">背包问题</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/C/">C++</a> / <a class="has-link-grey -link" href="/categories/C/Algorithm/">Algorithm</a>
                    </p>
                </div>
            </div>
        </article>
        
    </div>
</div>

        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            Archives
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2019/12/">
                <span class="level-start">
                    <span class="level-item">December 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/11/">
                <span class="level-start">
                    <span class="level-item">November 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/10/">
                <span class="level-start">
                    <span class="level-item">October 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/11/">
                <span class="level-start">
                    <span class="level-item">November 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/10/">
                <span class="level-start">
                    <span class="level-item">October 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                Tags
            </h3>
            <div class="field is-grouped is-grouped-multiline">
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/01背包问题/">
                        <span class="tag">01背包问题</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/BST/">
                        <span class="tag">BST</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Bigtiff/">
                        <span class="tag">Bigtiff</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/C/">
                        <span class="tag">C++</span>
                        <span class="tag is-grey">9</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Dijkstra/">
                        <span class="tag">Dijkstra</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Function/">
                        <span class="tag">Function</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/KKT/">
                        <span class="tag">KKT</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/LCS/">
                        <span class="tag">LCS</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Matlab/">
                        <span class="tag">Matlab</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/PAT/">
                        <span class="tag">PAT</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/PCA降维/">
                        <span class="tag">PCA降维</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Queue/">
                        <span class="tag">Queue</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/String/">
                        <span class="tag">String</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/hashing/">
                        <span class="tag">hashing</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/hashing查找/">
                        <span class="tag">hashing查找</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/三维图像/">
                        <span class="tag">三维图像</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/中序遍历/">
                        <span class="tag">中序遍历</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/二叉平衡树/">
                        <span class="tag">二叉平衡树</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/二叉搜索树/">
                        <span class="tag">二叉搜索树</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/二阶偏导数/">
                        <span class="tag">二阶偏导数</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/先序遍历/">
                        <span class="tag">先序遍历</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/凸函数，正交和投影/">
                        <span class="tag">凸函数，正交和投影</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/动态规划/">
                        <span class="tag">动态规划</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/变量类型/">
                        <span class="tag">变量类型</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/后序遍历/">
                        <span class="tag">后序遍历</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/堆排序/">
                        <span class="tag">堆排序</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/字符串/">
                        <span class="tag">字符串</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/完全二叉树/">
                        <span class="tag">完全二叉树</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/容器/">
                        <span class="tag">容器</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/常量/">
                        <span class="tag">常量</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/并查集/">
                        <span class="tag">并查集</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/广度-层次-遍历/">
                        <span class="tag">广度(层次)遍历</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/归并排序/">
                        <span class="tag">归并排序</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/拉格朗日乘子/">
                        <span class="tag">拉格朗日乘子</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/拓扑排序/">
                        <span class="tag">拓扑排序</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/指针/">
                        <span class="tag">指针</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/插入排序/">
                        <span class="tag">插入排序</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/文件读写/">
                        <span class="tag">文件读写</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/无偏估计/">
                        <span class="tag">无偏估计</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/朴素贝叶斯算法/">
                        <span class="tag">朴素贝叶斯算法</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/树状数组/">
                        <span class="tag">树状数组</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/梯度散度和旋度/">
                        <span class="tag">梯度散度和旋度</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/海森矩阵/">
                        <span class="tag">海森矩阵</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/深度遍历/">
                        <span class="tag">深度遍历</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/病毒标记/">
                        <span class="tag">病毒标记</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/算法/">
                        <span class="tag">算法</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/红黑树/">
                        <span class="tag">红黑树</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/背包问题/">
                        <span class="tag">背包问题</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/迪杰斯特拉算法，最短路径/">
                        <span class="tag">迪杰斯特拉算法，最短路径</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/高斯函数/">
                        <span class="tag">高斯函数</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
            </div>
        </div>
    </div>
</div>
        
        </div>
    
</div>

                

<!-- 粘贴的部分 -->

            </div>
        </div>
    </section>
    <footer class="footer">
    <div class="container">
        <div class="level">
            <div class="level-start has-text-centered-mobile">
				<script src="//code.tidio.co/3tnny2tdx9oh0xzuitaxzhuakj60ydfy.js"></script>
                <a class="footer-logo is-block has-mb-12" href="/">
                
                    <img src="/images/dk_logo.svg" alt="Matlab读写超过4GB的图像" width="304" height="50">
                
                </a>
                <p class="is-size-10">
                &copy; 2019 duankong&nbsp;
                Powered by <a href="https://hexo.io/" target="_blank">Hexo</a> & <a href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank">Icarus</a>
                
                <br>
                <span id="busuanzi_container_site_uv">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <i class="fa fa-bolt" aria-hidden="true "></i>
                Visited by <span id="busuanzi_value_site_uv">0</span> users
                <i class="fa fa-bolt" aria-hidden="true "></i>
                </span>
                
                </p>
            </div>
            
            <span id="timeDate">载入天数...</span><span id="times">载入时分秒...</span>
            <script>
                var now = new Date(); 
                function createtime() { 
                    var grt= new Date("5/25/2019 11:50:00");//此处修改你的建站时间或者网站上线时间 
                    now.setTime(now.getTime()+250); 
                    days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); 
                    hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); 
                    if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); 
                    mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} 
                    seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); 
                    snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} 
                    document.getElementById("timeDate").innerHTML = "Security Run For "+dnum+" Day "; 
                    document.getElementById("times").innerHTML = hnum + " Hour " + mnum + " Min " + snum + " Second"; 
                } 
            setInterval("createtime()",250);
            </script>
            
            <div class="level-end">
            
                <div class="field has-addons is-flex-center-mobile has-mt-5-mobile is-flex-wrap is-flex-middle">
                
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Creative Commons" href="https://creativecommons.org/">
                        
                        <i class="fab fa-creative-commons"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Attribution 4.0 International" href="https://creativecommons.org/licenses/by/4.0/">
                        
                        <i class="fab fa-creative-commons-by"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Download on GitHub" href="https://github.com/duankong">
                        
                        <i class="fab fa-github"></i>
                        
                    </a>
                </p>
                
                </div>
            
            </div>
        </div>
    </div>

	
</footer>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script>
<script>moment.locale("en");</script>


    
    
    
    <script src="/js/animation.js"></script>
    

    
    
    
    <script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script>
    <script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script>
    <script src="/js/gallery.js" defer></script>
    

    
    

<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update
            my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer></script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        });
    });
</script>


    
    
<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
    MathJax.Hub.Config({
        'HTML-CSS': {
            matchFontHeight: false
        },
        SVG: {
            matchFontHeight: false
        },
        CommonHTML: {
            matchFontHeight: false
        },
        tex2jax: {
            inlineMath: [
                ['$','$'],
                ['\\(','\\)']
            ]
        }
    });
});
</script>

    
    

<a id="back-to-top" title="Back to Top" href="javascript:;">
    <i class="fas fa-chevron-up"></i>
</a>
<script src="/js/back-to-top.js" defer></script>


    
    

    
    
    
    

    
    
    
    
    
    <script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script>
    <script src="/js/clipboard.js" defer></script>
    

    
    
    

    


<script src="/js/main.js" defer></script>

    
    <div class="searchbox ins-search">
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="Type something...">
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: 'Posts',
                PAGES: 'Pages',
                CATEGORIES: 'Categories',
                TAGS: 'Tags',
                UNTITLED: '(Untitled)',
            },
            CONTENT_URL: '/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/js/insight.js" defer></script>
<link rel="stylesheet" href="/css/search.css">
<link rel="stylesheet" href="/css/insight.css">
    
    

	
	<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/koharu.model.json"},"display":{"position":"left","width":150,"height":300},"mobile":{"show":true},"log":false});</script></body>

</html>